package com.chinacache.maint.webssh.entity.ssh;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import com.chinacache.maint.commons.entity.BaseEntity;

@Entity
@Table(name = "SSH_DEVICE")
public class Device extends BaseEntity {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private String devId;
	private String adminIp;
	private String adminPort;
	private String devName;
	private String devLabel;
	private Set<CommandLog> commandLogs = new HashSet<CommandLog>(0);

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "device")
	public Set<CommandLog> getCommandLogs() {
		return commandLogs;
	}

	public void setCommandLogs(Set<CommandLog> commandLogs) {
		this.commandLogs = commandLogs;
	}

	@Id
	@Column(name = "DEV_ID")
	public String getDevId() {
		return devId;
	}

	public void setDevId(String devId) {
		this.devId = devId;
	}

	@Column(name = "ADMIN_IP")
	public String getAdminIp() {
		return adminIp;
	}

	public void setAdminIp(String adminIp) {
		this.adminIp = adminIp;
	}

	@Column(name = "ADMIN_PORT")
	public String getAdminPort() {
		return adminPort;
	}

	public void setAdminPort(String adminPort) {
		this.adminPort = adminPort;
	}

	@Column(name = "DEV_NAME")
	public String getDevName() {
		return devName;
	}

	public void setDevName(String devName) {
		this.devName = devName;
	}

	@Column(name = "DEV_LABEL")
	public String getDevLabel() {
		return devLabel;
	}

	public void setDevLabel(String devLabel) {
		this.devLabel = devLabel;
	}

}
